package com.sinszm.wx;


import com.google.gson.Gson;
import com.googlecode.protobuf.format.JsonJacksonFormat;
import com.sinszm.wx.properties.BasicWxProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * SzmBasicWx自动配置
 *
 * @author chenjianbo
 */
@EnableConfigurationProperties({BasicWxProperties.class})
public class SzmWxAutoConfiguration {

    private final Gson gson;

    @Autowired
    public SzmWxAutoConfiguration(Gson gson) {
        this.gson = gson;
    }

    /**
     * 协议格式化工具
     */
    @Bean
    @ConditionalOnMissingBean
    public JsonJacksonFormat jsonJacksonFormat() {
        return new JsonJacksonFormat();
    }


}
